#define _CRT_SECURE_NO_WARNINGS
#include "Smartptr.h"


struct A {
	int _a1;
	int _a2;
};


int main1() {
	using namespace claus;
	shared_ptr<A> a(new A {1,5});
	shared_ptr<A> a0(new A{ 5,6 });
	std::cout << a.get_cont() << std::endl;
	shared_ptr<A> a1(a);
	std::cout << a.get_cont() << std::endl;
	shared_ptr<A> a2(a);
	std::cout << a.get_cont() << std::endl;
	shared_ptr<A> a3(a);
	std::cout << a.get_cont() << std::endl;
	shared_ptr<A> a4(a);
	std::cout << a.get_cont() << std::endl;
	a4 = a0;
	std::cout << a4->_a1 << std::endl;
	
	return 0;
}

#include <memory>
#include <cstdio>
int main() {
	using namespace std;

	shared_ptr<int> array((int*)malloc(sizeof(int) * 4), [](void* x) {free(x);});
	shared_ptr<FILE> a(fopen("clasiu.txt", "w"), [](FILE* f) {fclose(f); });
	return 0;
}

